<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('admin').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="incomeCreate" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Demonstrativo de Resultados do Exercício - DRE
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns">
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Filtros</h4></legend>
                            <p:panel id="resultPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix " >

                                <p:outputLabel for="de" value="De: " styleClass="grid_2"/>  
                                <p:calendar id="de" value="#{managerDre.dateInitial}"
                                            styleClass="grid_4"  showOn="button" pattern="dd/MM/yyyy"/> 

                                <p:outputLabel for="ate" value="Até: " styleClass="grid_2"/>  
                                <p:calendar id="ate" value="#{managerDre.dateFinal}" 
                                            styleClass="grid_4"  showOn="button" pattern="dd/MM/yyyy"/> 

                                <br/>
                                <div class="clear"/>
                                <div class="clear"/>

                                <div class="buttonAction">
                                    <p:remoteCommand name="remoteprint" 
                                                     oncomplete="print1.jq.click();"
                                                     process="@form" update="@form" />

                                    <p:commandButton value="Gerar" actionListener="#{managerDre.gerar()}" 
                                                     icon="ui-icon-print" styleClass="ui-priority-primary"
                                                     onclick="remoteprint();"
                                                     update="@form" process="@form"  />

                                    <p:commandButton widgetVar="print1"
                                                     style="display:none;"
                                                     value="Gerar" icon="ui-icon-print" immediate="true"
                                                     ajax="false" onclick="this.form.target='_blank'"
                                                     styleClass="ui-priority-primary" action="#{managerDre.imprimir()}"/>
                                </div>



                            </p:panel>
                        </fieldset>
<!--                        <fieldset style="display: none;">
                            <legend> <h4 style="margin:0 0 10px 0">Relatório</h4></legend>
                            <p:pieChart rendered="false" title="Entradas" showDataLabels="true" 
                                        styleClass="grid_12" style="height:450px"
                                        value="{managerDre.graficoEntrada}" legendPosition="w"/>
                            <p:pieChart rendered="false"  title="Saídas" showDataLabels="true" 
                                        styleClass="grid_12" style="height:450px"
                                        value="{managerDre.graficoSaida}" legendPosition="w"/>


                            <p:lineChart rendered="false"  title="Total de Procedimento por Mês"
                                          legendPosition="ne"  
                                          value="{managerIndex.linearProcedureDate}"  animate="true" 
                                          styleClass="grid_23" minY="0" minX="0" 
                                          maxY="{managerIndex.max}"
                                          xaxisLabel="Meses" yaxisLabel="Quantidade"/>
                        </fieldset>-->
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
